<?php
	class API_Exception	{
		public function get_response_object($error_code) {
			$error_msg = "";
			$return_object = array();

			switch ($error_code) {
				case 1001:
					$error_msg = "未知的接口";
					break;
				case 2000:
					$error_msg = "client_id 为空";
					break;
				case 2001:
					$error_msg = "topic 为空";
					break;
				case 2002:
					$error_msg = "username 为空";
					break;
				case 2003:
					$error_msg = "payload 为空";
					break;
				case 2004:
					$error_msg = "peername 为空";
					break;
				case 2004:
					$error_msg = "peername 为空";
					break;
				case 2005:
					$error_msg = "timestamp 为空";
					break;
				case 2006:
					$error_msg = "payload 内容解析错误";
					break;
			}

			$return_object = (object) array(
				"error_code" => $error_code,
				"error_msg" => $error_msg
			);

			return $return_object;
		}
	}
?>